package server

import (
	"goadmin-huasen-portal/svc"

	"github.com/gin-gonic/gin"
)

func NewRouter(serverCtx *svc.ServiceContext) *gin.Engine {
	r := gin.Default()
	//中间件
	r.Use(serverCtx.RateLimitMiddleware)
	v1 := r.Group("v1")
	{
		v1.GET("/", func(gin *gin.Context) {
			gin.JSON(200, "Welcome to Huasen Portal API")
		})
	}
	return r
}
